/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fingerprintapplication;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "PERSONS", catalog = "", schema = "APP")
@NamedQueries({@NamedQuery(name = "Persons.findAll", query = "SELECT p FROM Persons p"), @NamedQuery(name = "Persons.findById", query = "SELECT p FROM Persons p WHERE p.id = :id"), @NamedQuery(name = "Persons.findByIme", query = "SELECT p FROM Persons p WHERE p.ime = :ime"), @NamedQuery(name = "Persons.findByPrezime", query = "SELECT p FROM Persons p WHERE p.prezime = :prezime"), @NamedQuery(name = "Persons.findByAdresa", query = "SELECT p FROM Persons p WHERE p.adresa = :adresa"), @NamedQuery(name = "Persons.findByBrojlicne", query = "SELECT p FROM Persons p WHERE p.brojlicne = :brojlicne"), @NamedQuery(name = "Persons.findBySifraotiska", query = "SELECT p FROM Persons p WHERE p.sifraotiska = :sifraotiska")})
public class Persons implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "IME")
    private String ime;
    @Basic(optional = false)
    @Column(name = "PREZIME")
    private String prezime;
    @Column(name = "ADRESA")
    private String adresa;
    @Basic(optional = false)
    @Column(name = "BROJLICNE")
    private String brojlicne;
    @Basic(optional = false)
    @Column(name = "SIFRAOTISKA")
    private String sifraotiska;

    public Persons() {
    }

    public Persons(Integer id) {
        this.id = id;
    }

    public Persons(Integer id, String ime, String prezime, String brojlicne, String sifraotiska) {
        this.id = id;
        this.ime = ime;
        this.prezime = prezime;
        this.brojlicne = brojlicne;
        this.sifraotiska = sifraotiska;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        Integer oldId = this.id;
        this.id = id;
        changeSupport.firePropertyChange("id", oldId, id);
    }

    public String getIme() {
        return ime;
    }

    public void setIme(String ime) {
        String oldIme = this.ime;
        this.ime = ime;
        changeSupport.firePropertyChange("ime", oldIme, ime);
    }

    public String getPrezime() {
        return prezime;
    }

    public void setPrezime(String prezime) {
        String oldPrezime = this.prezime;
        this.prezime = prezime;
        changeSupport.firePropertyChange("prezime", oldPrezime, prezime);
    }

    public String getAdresa() {
        return adresa;
    }

    public void setAdresa(String adresa) {
        String oldAdresa = this.adresa;
        this.adresa = adresa;
        changeSupport.firePropertyChange("adresa", oldAdresa, adresa);
    }

    public String getBrojlicne() {
        return brojlicne;
    }

    public void setBrojlicne(String brojlicne) {
        String oldBrojlicne = this.brojlicne;
        this.brojlicne = brojlicne;
        changeSupport.firePropertyChange("brojlicne", oldBrojlicne, brojlicne);
    }

    public String getSifraotiska() {
        return sifraotiska;
    }

    public void setSifraotiska(String sifraotiska) {
        String oldSifraotiska = this.sifraotiska;
        this.sifraotiska = sifraotiska;
        changeSupport.firePropertyChange("sifraotiska", oldSifraotiska, sifraotiska);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Persons)) {
            return false;
        }
        Persons other = (Persons) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fingerprintapplication.Persons[id=" + id + "]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }

}
